﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Common.DataAnnotations
{
    /// <summary>
    /// 字段描述，允许不同场景使用不同的描述
    /// </summary>
    [AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
    public class FieldDescriptionAttribute : Attribute
    {
        /// <summary>
        /// 字段描述
        /// </summary>
        /// <param name="description"></param>
        public FieldDescriptionAttribute(string description) : this(description, "default")
        {
        }
        /// <summary>
        /// 字段描述
        /// </summary>
        /// <param name="description"></param>
        /// <param name="scene"></param>
        public FieldDescriptionAttribute(string description, string scene)
        {
            this.Description = description;
            this.Scene = scene;
        }
        /// <summary>
        /// 字段描述
        /// </summary>
        public string Description { get; private set; }
        /// <summary>
        /// 场景
        /// </summary>
        public string Scene { get; private set; }
    }
}
